package com.chase.springboot.service.impl;

import com.chase.springboot.mapper.UserMapper;
import com.chase.springboot.mapper.UserRoleMapper;
import com.chase.springboot.model.Role;
import com.chase.springboot.model.User;
import com.chase.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public boolean addUser(User user) {
        int i = userMapper.insert(user);
        return i > 0;
    }

    @Override
    public boolean deleteUserById(int id) {
        int i = userMapper.deleteByPrimaryKey(id);
        return i > 0;
    }

//    @Override
//    public List<Role> selectRoleByUserId(Integer id) {
//        return userRoleMapper.selectByUserId(id);
//    }
//
//    @Override
//    public boolean addRoleByUserId(Integer roleId) {
//        return userRoleMapper.;
//    }
//
//    @Override
//    public boolean deleteRoleByUserId(Integer id) {
//        return false;
//    }
}
